/**
 * SPDX-FileCopyrightText: 2023-2025 Sangfor Technologies Inc.
 * SPDX-License-Identifier: Mulan PSL v2
 */
<template>
    <a class="link-btn"
       :class="classObject"
       @click="onClick">
        <slot></slot>
    </a>
</template>

<style lang="stylus">
    .link-btn {
        color: #4677c6;
        margin-right: 9px;
        cursor: pointer;

        &:active,
        &:hover,
        &:focus,
        &:visited {
            text-decoration: none;
            color: #4677c6;
            background-color: transparent;
        }

        &.disabled {
            color: #bbb;
            cursor: not-allowed;
        }
    }

</style>

<script lang=ts>

/**
 * Created by czh on 2019/12/26.
 */

import { Vue, Component, Prop } from 'vue-property-decorator';

@Component
export default class LinkBtn extends Vue {
    @Prop({
        type: Boolean
    }) disabled!: boolean


    get classObject () {
        return {
            disabled: this.disabled
        };
    }

     onClick () {
        if (this.disabled) {
            return;
        }
        this.$emit('click');
    }
};

</script>
